Telegram Group & Telegram Channel
Гарантирует ли ConcurrentHashMap видимость между потоками? Нужно ли дополнительно синхронизировать put() и get() для корректной работы?

ConcurrentHashMap уже обеспечивает необходимую памятную видимость (happens-before) между put() и get() — дополнительная синхронизация не нужна.

Если put() завершился до начала get(), то get() обязательно увидит вставленное значение. Это гарантируется внутренней реализацией: через volatile поля, CAS-операции и memory barriers.

🐸 Библиотека собеса по Java
Please open Telegram to view this post
VIEW IN TELEGRAM
👍13🔥1👏1



tg-me.com/java_interview_lib/860
Create:
Last Update:

Гарантирует ли ConcurrentHashMap видимость между потоками? Нужно ли дополнительно синхронизировать put() и get() для корректной работы?

ConcurrentHashMap уже обеспечивает необходимую памятную видимость (happens-before) между put() и get() — дополнительная синхронизация не нужна.

Если put() завершился до начала get(), то get() обязательно увидит вставленное значение. Это гарантируется внутренней реализацией: через volatile поля, CAS-операции и memory barriers.

🐸 Библиотека собеса по Java

BY Библиотека собеса по Java | вопросы с собеседований


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/java_interview_lib/860

View MORE
Open in Telegram


Библиотека собеса по Java | вопросы с собеседований Telegram | DID YOU KNOW?

Date: |

NEWS: Telegram supports Facetime video calls NOW!

Secure video calling is in high demand. As an alternative to Zoom, many people are using end-to-end encrypted apps such as WhatsApp, FaceTime or Signal to speak to friends and family face-to-face since coronavirus lockdowns started to take place across the world. There’s another option—secure communications app Telegram just added video calling to its feature set, available on both iOS and Android. The new feature is also super secure—like Signal and WhatsApp and unlike Zoom (yet), video calls will be end-to-end encrypted.

Can I mute a Telegram group?

In recent times, Telegram has gained a lot of popularity because of the controversy over WhatsApp’s new privacy policy. In January 2021, Telegram was the most downloaded app worldwide and crossed 500 million monthly active users. And with so many active users on the app, people might get messages in bulk from a group or a channel that can be a little irritating. So to get rid of the same, you can mute groups, chats, and channels on Telegram just like WhatsApp. You can mute notifications for one hour, eight hours, or two days, or you can disable notifications forever.

Библиотека собеса по Java | вопросы с собеседований from ar


Telegram Библиотека собеса по Java | вопросы с собеседований
FROM USA